# 需求 破解百度翻译
import requests
import json
if __name__ == "_main_":
    post_url ='https://fanyi.baidu.com/sug'

    headers ={
        'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.42'

    }

    data = {
        'kw':'dog'
    }

    response = requests.post(url=post_url, data=data, headers=headers)

    dic_obj = response.json()

    fp = open('./dog.json', 'w', encoding='utf-8')
    json.dump(dic_obj,fp=fp,ensure_ascii=False)

    print('爬取成功！！！')
